
package com.dtease.agent.sse.server.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @description 消息协议
 *  协议格式
 * thinking_start
 * { "type": "thinking_start", "content": "", "title": "思考中" }
 * thinking_chunk
 * { "type": "thinking_chunk", "content": "思考片段", "title": "思考中" }
 * thinking_complete
 * { "type": "thinking_complete", "content": "", "title": "已深度思考（用时16s）" }
 * answer_start
 * { "type": "answer_start", "content": ""，title: "开始回答" }
 * answer_chunk
 * { "type": "answer_chunk", "content": "回答片段"，title: "已深度思考（用时16s）" }
 * answer_complete
 * { "type": "answer_complete", "content": ""，title: "已深度思考（用时16s）" }
 * suggestion
 * { "type": "suggestion", "content": "建议内容"，title: "已深度思考（用时16s）" }
* @author chentl
* @class EventMessage
* @package com.dtease.agent.sse.server.model
* @since 2025/5/1 18:11
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class EventMessage {
    // 事件类型（thinking/answer/chunk）
    private String type;
    // 事件标题
    private String title;
    // 内容
    private String content;
    // 时间戳，用于排序
    private long timestamp;

    public EventMessage(long timestamp) {
        this.timestamp = timestamp;
    }
}